<script setup lang="ts">
import MultiDimensional from '@/views/multiDimensional/index.vue'
import { ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useNavTabStore } from '@/stores/index'

const defaultNavPathInfo = ref<any>()
const routerPath = useRouter()
const route = useRoute()
const navTabStore = useNavTabStore()
const multiInfo = ref<any>()
watch(
  () => routerPath.currentRoute.value.path,
  () => {
    defaultNavPathInfo.value = route.meta.attributes
    multiInfo.value = defaultNavPathInfo.value.new_url
    if (route.meta.isMulti)
      navTabStore.setMultiInfo(multiInfo.value, routerPath.currentRoute.value.path)
    // console.log(newPath, oldPath)
  },
  { immediate: true, deep: true }
)
</script>
<template>
  <div class="multiBox">
    <div
      v-for="item in navTabStore.multiInfoArry"
      :key="item.path"
      v-show="item.path === route.fullPath"
    >
      <MultiDimensional />
    </div>
  </div>
</template>
<style scoped></style>
